
#include "comm.h"

int main()
{
    printf("client begin\n");
    // 以写方式打开命名管道文件
    int wfd = open(NAME_PIPE, O_WRONLY);
    printf("client end\n");
    if (wfd < 0)
        exit(1);

    char buffer[1024];
    while (1)
    {
        /* code */
        printf("Please Say# ");
        fgets(buffer, sizeof(buffer), stdin);
        ssize_t n = write(wfd, buffer, strlen(buffer));
        assert(n == strlen(buffer));
        (void)n;
    }

    close(wfd);
}